package kr.or.kead.ui.stdmgn;

import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.TableColumnModel;

public class StdList extends JPanel {

	private JTable table;
	
	public StdList(CustomTableModel model)
	{
		this.table = new JTable(model);
		table.setColumnSelectionAllowed(false);
		setColumnSize();
		JScrollPane scrollPane = new JScrollPane(table);
		scrollPane.setPreferredSize(new Dimension(1100, 400));
		add(scrollPane);
		
	}
	
	public void setTableModel(CustomTableModel model)
	{
		this.table.setModel(model);
		setColumnSize();
	}
	
	private void setColumnSize() {
		TableColumnModel model = table.getColumnModel();
		model.getColumn(0).setPreferredWidth(10);
		model.getColumn(1).setPreferredWidth(30);
		model.getColumn(2).setPreferredWidth(60);
		model.getColumn(3).setPreferredWidth(25);
		model.getColumn(4).setPreferredWidth(25);
		model.getColumn(5).setPreferredWidth(40);
		model.getColumn(6).setPreferredWidth(40);
		model.getColumn(7).setPreferredWidth(120);
		model.getColumn(8).setPreferredWidth(15);
		model.getColumn(9).setPreferredWidth(20);
		model.getColumn(10).setPreferredWidth(20);
		model.getColumn(11).setPreferredWidth(100);
		
			
	}
}
